<%= form_for(@stock) do |f| %>
  <% if @stock.errors.any? %>
    <div id="error_explanation">
      <h2><%= pluralize(@stock.errors.count, "error") %> prohibited this stock from being saved:</h2>

      <ul>
      <% @stock.errors.full_messages.each do |msg| %>
        <li><%= msg %></li>
      <% end %>
      </ul>
    </div>
  <% end %>

  <div>
    <%= f.label :name %><br />
    <%= f.text_field :name %>
    </div>

  <div>
    <%= f.label :purchase_date %><br />
    <%= f.date_select :purchase_date %>
    </div>

  <div>
    <%= f.label :purchase_cost %><br />
    <%= f.text_field :purchase_cost %>
    </div>

  <div>
    <%= f.label :purchase_quantity %><br />
    <%= f.text_field :purchase_quantity %>
    </div>

  <div>
    <%= f.label :free_quantity %><br />
    <%= f.text_field :free_quantity %>
    </div>

  <div>
    <%= f.label :sale_cost %><br />
    <%= f.text_field :sale_cost %>
    </div>

  <div>
    <%= f.label :company %><br />
    <%= f.text_field :company %>
    </div>

  <div>
    <%= f.label "Seller" %><br />
    <%= f.select(:seller_id,Seller.all.collect {|p| [ p.name, p.id ] }, {:include_blank => true}) %>
    </div>
  <div>
  <div>
    <%= f.label :tax_percentage %><br />
    <%= f.text_field :tax_percentage %>
    </div>
  <div>
    <%= f.label :commission %><br />
    <%= f.text_field :commission %>
    </div>
    <%= f.submit %>
    </div>
<% end %>
